<template>
	<view class="newsDetails">
		<view class="title">{{newsList.title}}</view>
		<view class="author"><text style="color: #576b95;padding-right: 20rpx;">{{newsList.author}}</text> <text style="color: #b2b2b2;">{{newsList.publicationTime}}</text></view>
		<view class="content" v-html="newsList.content"></view>
	</view>
</template>

<script>
	import {
		Get_Article
	} from '../../../api/user.js'
	export default {
		data() {
			return {
				id: "",
				newsList: ''
			};
		},
		methods: {
			// 获取新闻列表
			getNewslist(e) {
				Get_Article(e).then((res) => {
					if (res == null) {
						this.bottomShow = true
						return
					}
					this.newsList = res
				})
			},
		},
		onLoad(options) {
			this.id = options.id
		},
		onShow() {
			this.getNewslist({
				id:this.id
			})
		}
	}
</script>

<style lang="scss" scoped>
	.newsDetails {
		padding: 20rpx;
		.title {
			font-size: 40rpx;
		}
		.author{
			margin: 30rpx 0;
			font-size: 28rpx;
		}
	}
</style>
